#ifndef _HEAP_H
#define _HEAP_H

#pragma warning(disable: 4996)

#include "bib_Log.h"
#include "bib_Hilos.h"
#include "bib_Cache.h"

#include <stdlib.h>

#include <winsock2.h>
#pragma comment (lib, "Ws2_32.lib")

#define TAM_ERROR 100
#define TAM_HEAP 1024 * 1024

int crearHeap(HANDLE *heap);
int destruirHeap(HANDLE heap);
int alocarMemoria(HANDLE heap, int cant, LPVOID *ptr);
int liberarMemoria(HANDLE heap, void *ptr);
int agregarRegCache(long sector, char *datos, HANDLE heap);
int eliminarRegCache(HANDLE heap);
int ponerAlFinal(struct REG_CACHE *anterior, struct REG_CACHE *actual);
int anteUltimaPosicion(char *contenidoSector);

#endif